package servlets;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by anna on 6/18/14.
 */
@WebServlet(name = "LoginServlet", urlPatterns = {"/login"})
public class LoginServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException {
        System.out.println("WE ARE HERE");
        String user = httpServletRequest.getParameter("user");
        String pwd = httpServletRequest.getParameter("pwd");
    }

    @Override
    protected void doPost(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException {
        System.out.println("WE ARE SOMEWHERE ELSE");
        String user = httpServletRequest.getParameter("user");
        String pwd = httpServletRequest.getParameter("pwd");
        System.out.println("user = " + user);
        System.out.println("pwd = " + pwd);
    }

}
